package com.zx._10_设计模式.创建型模式.原型模式;

import com.zx._10_设计模式.创建型模式.原型模式.model.Model1;

/**
 * @version v1.0
 * @Project: design_pattern
 * @Title: Prototype1
 * @Description: 使用clone
 * @author: zhangxue
 * @date: 2020年3月5日下午6:05:16
 * @company: 未知
 * @Copyright: Copyright (c) 2015
 */
public class Prototype1 {

    private static Model1 model = new Model1();

    public static Model1 getObj() throws CloneNotSupportedException {
        return (Model1) model.clone();
    }

    public static void main(String[] args) throws Exception {
        System.out.println(Prototype1.getObj());
        System.out.println(Prototype1.getObj());
        System.out.println(Prototype1.getObj());
    }
}
